package com.qf.controller;

import com.qf.pojo.reqVo.ShopcartReq;
import com.qf.pojo.respVo.BaseResp;
import com.qf.service.ShopCartService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.servlet.http.HttpServletRequest;
import java.util.Base64;

/**
 * @Author: 陌人不故
 * @Date: 2022/10/29/14:07
 */
@RestController
@RequestMapping("/shopcart")
public class ShopCartController {

    @Autowired
    ShopCartService shopCartService;

    @RequestMapping("/add")
    public BaseResp add(HttpServletRequest request, @RequestBody ShopcartReq shopcartReq){
        return shopCartService.add(request,shopcartReq);
    }

    @RequestMapping("/findShopCardByToken")
    public BaseResp findShopCardByToken(HttpServletRequest request){
        return shopCartService.findShopCardByToken(request);
    }

    @RequestMapping("/delShop")
    public BaseResp delShop(HttpServletRequest request,@RequestBody ShopcartReq shopcartReq){
        return shopCartService.delShop(request,shopcartReq);
    }
}
